package com.shiyanlou.upms.system.dao;

import com.shiyanlou.upms.system.domain.UpmsPermission;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;
import java.util.Set;

@Mapper
public interface UpmsPermissionMapper {
    int deleteByPrimaryKey(Integer permissionId);

    int insert(UpmsPermission record);

    int insertSelective(UpmsPermission record);

    UpmsPermission selectByPrimaryKey(Integer permissionId);

    int updateByPrimaryKeySelective(UpmsPermission record);

    int updateByPrimaryKey(UpmsPermission record);

    int count(Map<String, Object> map);

    List<UpmsPermission> list(Map<String, Object> map);

    int batchRemove(Integer[] userIds);

    // 通过用户ID获取目录菜单信息
    List<UpmsPermission> selectPermissionByUserId(Integer userId);

    // 通过角色 ID 获取目录菜单信息
    List<UpmsPermission> selectPermissionByRoleId(Integer roleId);

    //通过用户 ID 查询资源信息
    Set<String> selectByUserId(Integer userId);


}